<?php session_start(); ?>
<?php include_once('misc/class_config.php'); ?>

<?php 
	include('access_control/page_access.php');
	setPreviousPage();
	$currentUser = new user();
	$currentUser->isLoggedIn();
	$currentUser->isTimedOut();
?>
<?php
	if(!$currentUser->loggedIn)
	{
		include('controller/loginformcontroller.php'); 
	}
?>
<?php $pageTitle = "Home | Everything"; ?>
<?php include('layout/page_start.php'); ?>
<?php include('layout/page_header.php'); ?>
<?php
	if(!$currentUser->loggedIn)
	{
		include('layout/loginform.php'); 
	}
?>
<?php include('layout/menu_bar.php'); ?>
<div id="main_content_div">
<?php
	if($currentUser->loggedIn)
	{
		if($currentUser->timedOut)
		{
			include_once "layout/timeout.php";
			$currentUser->timeoutUser();
		}
	}
?>
<?php include('layout/index_main_content.php'); ?>
</div>
</div>

<?php include('layout/page_footer.php'); ?>
<?php include('layout/page_end.php'); ?>
<?php setCurrentPage();?>